package com.hnkywl.sts.util;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-4-12
 * Time: 下午4:06
 * To change this template use File | Settings | File Templates.
 */
public abstract class QuerySearcher {
    public String joinSearcher(String... searchers) {
        StringBuilder result = new StringBuilder();
        for (String searcher : searchers) {
            if (searcher != "") {
                result.append(" and " + "(" + searcher  + ")");
            }
        }
        if (result.toString() != "") {
            return result.toString().replaceFirst("and","where");
        } else {
            return "";
        }
    }

    public abstract String getHql();

    public abstract String getSql();
}
